#delimit;
clear;

shp2dta using US_state_2012.shp, database(20161011_StateMap) coordinates(20161011_StateMap_coord) genid(id) replace;


use 20161011_StateMap.dta, clear;

destring STATEFP, gen(FIPS);

save 20161011_StateMap_data.dta, replace;


use 20161021_State_Parameters_w_Var.dta, clear; 

merge 1:1 FIPS using 20161011_StateMap_data.dta;

drop if _merge~=3;
replace R_2=round(R_2*100);

format R_2 %4.0f;

spmap R_2 using 20161011_StateMap_coord if id!=1 & id!=45, id(id) 
  fcolor(gs16 gs12 gs8 gs4) 
  osize(vvthin vvthin vvthin vvthin)
  legend(title("Poverty Relief Ratio (R)", size(vsmall)));

graph save 20161021_Map.gph, replace;
graph export 20161021_Map.pdf, replace fontface("Helvetica");



